import React from 'react';
import { createForm } from 'rc-form';
import { WhiteSpace,List,Toast } from 'antd-mobile';
import { hashHistory} from 'react-router';
import 'antd-mobile/dist/antd-mobile.css';

const Item = List.Item;
let userMsg ={};
class MyMenu extends React.Component {



    constructor(props) {
        super(props);
        this.state = {
            pickerValue: [],
            dpValue: null,
        };
    }
    componentDidMount() {
        this.props.changeTitle('账户安全');
    }

    componentWillMount(){
        userMsg = this.props.location.state
    }

    //修改密码
    updatePwd = (e) => {
        if (userMsg.user_name === ''){
            Toast.info("请先登录！",1);
        }else {
            hashHistory.push({
                pathname: '/user/updatePwd',
                state:userMsg
            })
        }
    }
    render() {
        return (
            <List className="my-list">
                <WhiteSpace/>
                <Item onClick={this.updatePwd}>修改密码</Item>
            </List>
        );
    }
}

export default createForm()(MyMenu);
